import CPXHTYPE from "@/type/cpxh"
import { isCodeMessage } from "../../config"
import CPXMTYPE from "@/type/cpxm"

/**
 * @author: 小佘佘🦀
 * @description: 修改Cpxh
 * @param {CPXHTYPE} cpxh
 * */
export const updateCpxh = async (cpxh: CPXHTYPE) => {

    const response = await fetch(`/api-backend/api/team/upcpxh`, {
        method: "POST",
        headers: {
            "content-type": "application/json;charset=utf-8",
        },
        body: JSON.stringify(cpxh),
        redirect: "manual"
    })

    return isCodeMessage(response)
}

/**
 * @author: 小佘佘🦀
 * @description: 修改Cpxm
 * @param {CPXMTYPE} cpxm
 * */
export const updateCpxm = async (cpxm: CPXMTYPE) => {

    const response = await fetch(`/api-backend/api/team/upcpxm`, {
        method: "POST",
        headers: {
            "content-type": "application/json;charset=utf-8",
        },
        body: JSON.stringify(cpxm),
        redirect: "manual"
    })

    return isCodeMessage(response)
}